/*
	Copyright (c) 2010 <copyright holders>
	This source code is licensed under The MIT License,
	see the file LICENSE for details.
	*/

#ifndef MENUNETLOGIC_HPP
#define MENUNETLOGIC_HPP

#include "ForwardDecls.hpp"
#include "MessageRegisters.hpp"
#include "Net.hpp"

namespace spelprog2 {
namespace gui {

namespace net_logic {

class MenuNetListener : public net::NetMessageListener {
protected:
    MenuGUI & gui_;
public:
    MenuNetListener(MenuGUI & gui) : net::NetMessageListener(), gui_(gui) {}
    virtual ~MenuNetListener() { }
};

struct HandleChatMessage : public MenuNetListener {
    HandleChatMessage(MenuGUI & gui) : MenuNetListener(gui) { }
    void onMessage(MessagePtr msg, const net::NetMessageInfo & info);
};

struct HandleStartGame : public MenuNetListener {
    HandleStartGame(MenuGUI & gui) : MenuNetListener(gui) { }
    void onMessage(MessagePtr msg, const net::NetMessageInfo & info);
};

}; //namespace net_logic
}; //gui
}; //spelprog2

#endif //MENUNETLOGIC_HPP